From 015ff46633afe0d9f1050f769bd43a7bff9ccdd9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 28 Feb 2017 18:44:33 -0500 Subject: [PATCH] Convince OS X to fully fullscreen windows We typically want to have the full screen given to the content, not the aspect-ratio preserving behavior that newer OS X has. https://bugzilla.gnome.org/show_bug.cgi?id=779383 --- gdk/quartz/GdkQuartzNSWindow.c | 15 +++++++++++++++ gdk/quartz/GdkQuartzNSWindow.h | 1 + 2 files changed, 16 insertions(+) diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c index cafabf4522..d85056be85 100644 --- a/gdk/quartz/GdkQuartzNSWindow.c +++ b/gdk/quartz/GdkQuartzNSWindow.c @@ -838,4 +838,19 @@ update_context_from_dragging_info (id sender) inMaximizeTransition = NO; } +-(NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize +{ + return [[window screen] frame].size; +} + +-(void)windowWillEnterFullScreen:(NSNotification *)aNotification +{ + lastUnfullscreenFrame = [self frame]; +} + +-(void)windowWillExitFullScreen:(NSNotification *)aNotification +{ + [self setFrame:lastUnfullscreenFrame display:YES] +} + @end diff --git a/gdk/quartz/GdkQuartzNSWindow.h b/gdk/quartz/GdkQuartzNSWindow.h index 31175da255..b8edf43e69 100644 --- a/gdk/quartz/GdkQuartzNSWindow.h +++ b/gdk/quartz/GdkQuartzNSWindow.h @@ -37,6 +37,7 @@ NSRect lastUnmaximizedFrame; NSRect lastMaximizedFrame; + NSRect lastUnfullscreenFrame; BOOL inMaximizeTransition; } -- 2.30.2